package com.david.jetpack.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.navigation.fragment.findNavController
import com.david.jetpack.R

class FragmentFirst: Fragment() {
    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        val view = TextView(requireContext())
        view.text = "navToSecond"
        view.setOnClickListener {
            findNavController().navigate(R.id.first_to_second)
        }
        return view
    }
}